<@compress single_line=true>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>StonesAdmin</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=0">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <link rel="stylesheet" href="/resources/css/administrate/login.css"/>
</head>
<body class="body_bj"
      style="background-image: url(/resources/images/administrate/login_background.jpg);filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/resources/images/administrate/login_background.jpg',sizingMethod='scale');">
<div id="particles-js">
    <div class="login">
        <div class="logo">
            <img src="/resources/images/administrate/login_logo.png" alt="">
        </div>
        <ul class="login-list">
            <li><input type="text" id="username" value="stones" placeholder="请输入用户名"></li>
            <li><input type="password" id="password" placeholder="请输入密码"></li>
            <li><input type="text" id="kaptcha" placeholder="请输入验证码"><span class="yzm2"><img
                    src="/administrate/gate/login/captcha.jpg" alt="验证码"></span>
            </li>
            <li><a class="btn" href="javascript:;" id="btn_submit">登 录</a></li>
        </ul>
    </div>
</div>
</body>
<script src="/resources/plugin/layui/layui.js"></script>
<script>
    layui.use(['jquery', "element", 'layer'], function () {
        var $ = layui.jquery;
        $(function () {
            /*回车*/
            $(document).keyup(function (event) {
                if (event.keyCode == 13) {
                    $("#btn_submit").trigger("click");
                }
            });
            $("#btn_submit").on("click", function () {
                var username = $("#username").val();
                var password = $("#password").val();
                var kaptcha = $("#kaptcha").val();
                if (username == '') {
                    layer.msg("请输入用户名");
                    return;
                }
                if (password == '') {
                    layer.msg("请输入密码");
                    return;
                }
                if (kaptcha == '') {
                    layer.msg("请输入验证码");
                    return;
                }
                $.ajax({
                    type: "POST",
                    url: "/administrate/gate/login/check",
                    data: {"username": username, "password": password, "kaptcha": kaptcha},
                    async: false,
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 500) {
                            layer.msg(result.msg);
                            $(".yzm2").trigger("click");
                            $("#username").val("");
                            $("#password").val("");
                            $("#kaptcha").val("");
                        }
                        else {
                            layer.msg("登录成功");
                            location.href = "/administrate";
                        }
                    }
                });
            });
            $(".yzm2").on("click", function () {
                $(this).find("img").attr("src", $(this).find("img").attr("src") + "?t=" + $.now());
            });
        });
    });
</script>
</html>
</@compress>